home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_20_1987_Transactor_Publishing.d64
/
read any sector
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
42 lines
100 rem********************************
110 rem*** read any sector ***
120 rem*** by frank digioia ***
130 rem********************************
140 rem the transactor vol 8 issue 3
150 rem********************************
160 open15,8,15,"i0"
170 t=1:s=1:x=0:dim a(255)
180 ts$="m-w"+chr$(6)+chr$(0)+chr$(2)
190 sj$="m-w"+chr$(0)+chr$(0)+chr$(1)
200 input"[147]track";t
210 if t<1 or t>40 then 200
220 input"sector";s:if s<0 then 220
230 print#15,ts$;chr$(t)chr$(s)
240 print#15,sj$;chr$(176):rem do seek
250 gosub 420:rem await completion
260 print#15,ts$;chr$(t)chr$(s)
270 print#15,sj$;chr$(128):rem do read
280 gosub 420:rem await completion
290 print#15,"m-r"chr$(0)chr$(3)chr$(255)
300 print"[147]":fori=0to255:get#15,a$
310 a(i)=asc(a$+chr$(0)):print a$;:next
320 print"hit any key for screen codes"
330 poke198,0:wait198,1:geta$:print"[147]"
340 fori=0to255:poke1024+i,a(i)
345 poke55296+i,1:next: rem colour ram
350 print"hit a key for ascii codes"
360 poke198,0:wait198,1:geta$:print""
370 fori=0to255:print a(i);:next
380 print#15,"i0":close15:end
390 rem********************************
400 rem wait for activity complete
410 rem********************************
420 fori=1to3000:next:rem initial delay
430 print#15,"m-r"chr$(0)chr$(0)
440 get#15,a$:a=asc(a$+chr$(0))
450 if a=176 then print"seeking track"
460 if a=128 then print"reading sector"
470 x=x+1:if a>127 and x<11 then 420
480 if a=1 then print"okay":x=0:return
490 print"error!!!":print#15,"u:":stop